<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Creates a new CairoMatrix object</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.cairomatrix.html">CairoMatrix</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairomatrix.initidentity.html">CairoMatrix::initIdentity</a></div>
 <div class="up"><a href="class.cairomatrix.html">CairoMatrix</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cairomatrix.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">CairoMatrix::__construct</h1>
  <h1 class="refname">cairo_matrix_init</h1>
  <p class="verinfo">(PECL cairo &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">CairoMatrix::__construct</span> -- <span class="refname">cairo_matrix_init</span> &mdash; <span class="dc-title">Creates a new CairoMatrix object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-cairomatrix.construct-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格 (method):</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>CairoMatrix::__construct</strong></span>
    ([ <span class="methodparam"><span class="type">float</span> <code class="parameter">$xx</code><span class="initializer"> = 1.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$yx</code><span class="initializer"> = 0.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$xy</code><span class="initializer"> = 0.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$yy</code><span class="initializer"> = 1.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$x0</code><span class="initializer"> = 0.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$y0</code><span class="initializer"> = 0.0</span></span>
  ]]]]]] )</div>

  <p class="para rdfs-comment">过程化风格:</p>
  <div class="methodsynopsis dc-description">
   <span class="type">object</span> <span class="methodname"><strong>cairo_matrix_init</strong></span>
    ([ <span class="methodparam"><span class="type">float</span> <code class="parameter">$xx</code><span class="initializer"> = 1.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$yx</code><span class="initializer"> = 0.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$xy</code><span class="initializer"> = 0.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$yy</code><span class="initializer"> = 1.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$x0</code><span class="initializer"> = 0.0</span></span>
   [, <span class="methodparam"><span class="type">float</span> <code class="parameter">$y0</code><span class="initializer"> = 0.0</span></span>
  ]]]]]] )</div>

  <p class="para rdfs-comment">
   Returns new CairoMatrix object.  Matrices are used throughout cairo to convert between different coordinate spaces.
   Sets matrix to be the affine transformation given by xx, yx, xy, yy, x0, y0. The transformation is given by:
   x_new = xx * x + xy * y + x0; and y_new = yx * x + yy * y + y0;
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-cairomatrix.construct-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">xx</code></em></dt>

     <dd>

      <p class="para">
       xx component of the affine transformation 
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">yx</code></em></dt>

     <dd>

      <p class="para">
       yx component of the affine transformation 
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">xy</code></em></dt>

     <dd>

      <p class="para">
       xy component of the affine transformation
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">yy</code></em></dt>

     <dd>

      <p class="para">
       yy component of the affine transformation
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">x0</code></em></dt>

     <dd>

      <p class="para">
       X translation component of the affine transformation 
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">y0</code></em></dt>

     <dd>

      <p class="para">
       Y translation component of the affine transformation 
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-cairomatrix.construct-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a new CairoMatrix object that can be used with surfaces, contexts, and patterns.
  </p>
 </div>


<div class="refsect1 examples" id="refsect1-cairomatrix.construct-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3077">
    <p><strong>Example #1 面向对象风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;a&nbsp;new&nbsp;Matrix&nbsp;*/<br /></span><span style="color: #0000BB">$matrix&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">CairoMatrix</span><span style="color: #007700">(</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.5</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-3078">
    <p><strong>Example #2 过程化风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;a&nbsp;new&nbsp;Matrix&nbsp;*/<br /></span><span style="color: #0000BB">$matrix&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cairo_matrix_init</span><span style="color: #007700">(</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.5</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

   </div>
  </p>
 </div>



 <div class="refsect1 seealso" id="refsect1-cairomatrix.construct-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="cairomatrix.initidentity.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::initIdentity()</a> - Creates a new identity matrix</span></li>
    <li class="member"><span class="methodname"><a href="cairomatrix.initrotate.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::initRotate()</a> - Creates a new rotated matrix</span></li>
    <li class="member"><span class="methodname"><a href="cairomatrix.initscale.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::initScale()</a> - Creates a new scaling matrix</span></li>
    <li class="member"><span class="methodname"><a href="cairomatrix.inittranslate.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::initTranslate()</a> - Creates a new translation matrix</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.cairomatrix.html">CairoMatrix</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairomatrix.initidentity.html">CairoMatrix::initIdentity</a></div>
 <div class="up"><a href="class.cairomatrix.html">CairoMatrix</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
